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

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

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

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

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

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

e.w = c
e.x = c
e.t = n
e.o = n
k.w = b
k.r = n
n.w = e
n.p = k
f.o = n
f.z = b
f.x = b
f.v = b
b.y = n
c.w = e
c.x = e
c.t = n
c.o = n
assert k.w.y.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.x: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

e.w = c
e.x = c
e.t = n
e.o = n
k.w = b
k.r = n
n.w = e
n.p = k
f.o = n
f.z = b
f.x = b
f.v = b
b.y = n
c.w = e
c.x = e
c.t = n
c.o = n
assert k.w.y.p.r.txt == "n"