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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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