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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.o: D = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: I = None
        self.r: E = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: B = None
        self.p: C = None
        self.y: H = None
        self.o: H = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: E = None
        self.p: E = None
        self.u: F = None
        self.w: A = None
        self.y: C = None
        self.q: I = None
        self.x: A = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

i.o = c
c.q = j
c.x = j
c.o = f
c.z = m
c.p = d
a.w = m
a.x = m
a.s = e
f.z = j
f.w = e
f.r = n
f.o = h
n.s = e
n.z = c
n.p = a
n.y = h
n.o = h
n.w = j
d.z = h
j.t = h
j.z = n
j.p = n
j.u = d
j.o = d
j.w = i
j.x = i
j.y = m
j.q = e
h.q = e
h.y = d
e.q = h
m.w = a
m.x = a
m.s = e
assert i.o.x.t.y.z.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.o: D = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: I = None
        self.r: E = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: B = None
        self.p: C = None
        self.y: H = None
        self.o: H = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: E = None
        self.p: E = None
        self.u: F = None
        self.w: A = None
        self.y: C = None
        self.q: I = None
        self.x: A = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

i.o = c
c.q = j
c.x = j
c.o = f
c.z = m
c.p = d
a.w = m
a.x = m
a.s = e
f.z = j
f.w = e
f.r = n
f.o = h
n.s = e
n.z = c
n.p = a
n.y = h
n.o = h
n.w = j
d.z = h
j.t = h
j.z = n
j.p = n
j.u = d
j.o = d
j.w = i
j.x = i
j.y = m
j.q = e
h.q = e
h.y = d
e.q = h
m.w = a
m.x = a
m.s = e
assert i.o.x.t.y.z.q.q.txt == "h"