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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: F = None
        self.x: A = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
i = C("i")
b = D("b")
k = E("k")
j = F("j")

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: F = None
        self.x: A = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
i = C("i")
b = D("b")
k = E("k")
j = F("j")

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