class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.v: H = None
        self.x: F = None
        self.y: F = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: G = None
        self.u: D = None
        self.w: H = None
        self.x: H = None
        self.o: H = None
        self.t: A = None
        self.p: I = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.z: G = None
        self.txt = txt

c = A("c")
i = B("i")
d = C("d")
n = D("n")
j = E("j")
k = F("k")
f = G("f")
g = H("g")
m = I("m")

c.p = k
i.p = j
d.p = f
d.t = j
d.v = g
d.w = g
d.x = k
d.y = k
n.o = c
n.y = d
n.w = m
j.o = i
k.v = f
k.y = f
k.u = n
k.s = n
k.w = g
k.x = g
k.o = g
k.t = c
k.p = m
f.z = n
f.o = n
g.t = k
m.t = j
m.r = i
m.z = f
assert g.t.o.t.t.p.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.v: H = None
        self.x: F = None
        self.y: F = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: G = None
        self.u: D = None
        self.w: H = None
        self.x: H = None
        self.o: H = None
        self.t: A = None
        self.p: I = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.z: G = None
        self.txt = txt

c = A("c")
i = B("i")
d = C("d")
n = D("n")
j = E("j")
k = F("k")
f = G("f")
g = H("g")
m = I("m")

c.p = k
i.p = j
d.p = f
d.t = j
d.v = g
d.w = g
d.x = k
d.y = k
n.o = c
n.y = d
n.w = m
j.o = i
k.v = f
k.y = f
k.u = n
k.s = n
k.w = g
k.x = g
k.o = g
k.t = c
k.p = m
f.z = n
f.o = n
g.t = k
m.t = j
m.r = i
m.z = f
assert g.t.o.t.t.p.s.y.txt == "d"