class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

i = A("i")
g = B("g")
a = C("a")
h = D("h")
j = E("j")
m = F("m")
k = C("k")
d = A("d")
c = E("c")
f = C("f")

i.w = d
i.u = a
i.y = h
i.p = c
g.z = m
g.o = m
g.y = h
g.p = j
a.x = g
a.u = h
h.u = a
h.o = g
j.o = h
m.v = c
m.q = h
m.x = j
m.t = f
k.x = g
k.u = h
d.w = i
d.u = k
d.y = h
d.p = c
c.o = h
f.x = g
f.u = h
assert c.o.o.p.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

i = A("i")
g = B("g")
a = C("a")
h = D("h")
j = E("j")
m = F("m")
k = C("k")
d = A("d")
c = E("c")
f = C("f")

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