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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.o: D = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

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

f = A("f")
e = B("e")
j = C("j")
d = D("d")
n = E("n")
b = E("b")

f.r = j
f.x = d
f.o = e
e.w = d
e.z = d
e.o = d
e.y = j
e.v = j
j.s = f
d.v = e
d.x = f
d.r = f
n.x = b
b.x = n
assert j.s.r.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.o: D = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

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

f = A("f")
e = B("e")
j = C("j")
d = D("d")
n = E("n")
b = E("b")

f.r = j
f.x = d
f.o = e
e.w = d
e.z = d
e.o = d
e.y = j
e.v = j
j.s = f
d.v = e
d.x = f
d.r = f
n.x = b
b.x = n
assert j.s.r.s.o.txt == "e"