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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.r: F = None
        self.u: E = None
        self.q: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.r: F = None
        self.u: E = None
        self.q: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

d.x = g
d.u = i
d.o = i
e.o = d
e.q = d
e.w = c
e.u = c
e.r = k
e.p = l
i.o = e
i.y = a
i.q = d
a.u = d
a.w = g
a.r = g
a.p = i
l.p = c
l.t = e
l.z = e
l.x = i
k.p = e
f.p = e
m.x = g
m.u = i
m.o = i
c.p = l
c.t = e
c.z = e
c.x = i
g.u = m
g.w = a
g.r = a
g.p = i
assert g.p.y.p.o.o.txt == "d"