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

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

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

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

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

c = A("c")
l = B("l")
a = C("a")
e = D("e")
b = E("b")
f = A("f")

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

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

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

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

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

c = A("c")
l = B("l")
a = C("a")
e = D("e")
b = E("b")
f = A("f")

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