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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.v: E = None
        self.y: D = None
        self.o: G = None
        self.r: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: A = None
        self.s: B = None
        self.y: G = None
        self.v: F = None
        self.q: C = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.v: E = None
        self.y: D = None
        self.o: G = None
        self.r: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: A = None
        self.s: B = None
        self.y: G = None
        self.v: F = None
        self.q: C = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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