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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: A = None
        self.x: E = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: C = None
        self.r: B = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

d = A("d")
e = B("e")
l = C("l")
a = D("a")
b = E("b")
g = F("g")
j = E("j")
c = A("c")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: A = None
        self.x: E = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: C = None
        self.r: B = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

d = A("d")
e = B("e")
l = C("l")
a = D("a")
b = E("b")
g = F("g")
j = E("j")
c = A("c")

d.o = l
d.t = b
d.z = a
e.w = c
e.p = l
l.q = g
l.y = g
l.s = c
l.x = b
l.p = a
a.z = b
a.o = g
b.x = a
b.u = d
b.p = c
g.z = c
g.y = l
g.r = e
g.u = e
g.o = j
j.x = a
j.u = d
j.p = d
c.o = l
c.t = j
c.z = a
assert l.q.u.p.x.u.z.txt == "a"