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

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

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

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

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

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

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

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

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

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

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

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

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