package no313; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Main { public static final int MAX = 200000; public static void main(String[] args) { solve(); } public static void solve() { Scanner sc = new Scanner(System.in); String s = sc.next(); String pi = s.substring(0, 1) + s.substring(2, s.length()); long sum = 0; long weightedsum = 0; for(int i=0;i<=MAX;i++) { int d = pi.charAt(i) - '0'; sum += d; weightedsum += d * (i+1); } long diff = sum - SUM; int index = (int) ((weightedsum - WEIGHTED_SUM) / diff - 1); int miss = pi.charAt(index) - '0'; System.out.println(miss + " " + (miss + 10 - diff) % 10); } public static final long SUM = 899117; public static final long WEIGHTED_SUM = 89939722901L; public static void calc() { try { Scanner sc = new Scanner(new File("pi.txt")); sc.next(); StringBuilder sb = new StringBuilder(); sb.append("3"); while(sb.length() <= MAX) { sb.append(sc.next()); } String pi = sb.toString(); long sum = 0; long weightedsum = 0; for(int i=0;i<=MAX;i++) { int d = pi.charAt(i) - '0'; sum += d; weightedsum += d * (i+1); } System.out.println(sum); System.out.println(weightedsum); } catch (FileNotFoundException e) { e.printStackTrace(); } } }