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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.u: C = None
        self.p: C = None
        self.r: B = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.w: C = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

f = A("f")
n = B("n")
b = C("b")
e = D("e")
a = E("a")
k = F("k")

f.p = a
n.w = k
n.t = a
b.x = n
b.w = e
e.y = n
e.q = n
e.r = n
e.u = b
e.p = b
e.t = a
a.s = b
a.u = b
k.t = n
k.x = b
k.w = b
k.o = b
k.q = e
assert e.p.x.t.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.u: C = None
        self.p: C = None
        self.r: B = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.w: C = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

f = A("f")
n = B("n")
b = C("b")
e = D("e")
a = E("a")
k = F("k")

f.p = a
n.w = k
n.t = a
b.x = n
b.w = e
e.y = n
e.q = n
e.r = n
e.u = b
e.p = b
e.t = a
a.s = b
a.u = b
k.t = n
k.x = b
k.w = b
k.o = b
k.q = e
assert e.p.x.t.s.x.txt == "n"