class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: F = None
        self.x: F = None
        self.u: B = None
        self.t: E = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.q: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
e = D("e")
k = E("k")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.q: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
e = D("e")
k = E("k")
a = F("a")

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