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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: E = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

e.w = j
e.p = f
e.s = b
j.u = k
j.o = f
j.t = e
a.o = b
a.w = f
k.u = b
f.v = a
f.q = b
b.u = k
assert e.s.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: E = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

e.w = j
e.p = f
e.s = b
j.u = k
j.o = f
j.t = e
a.o = b
a.w = f
k.u = b
f.v = a
f.q = b
b.u = k
assert e.s.u.u.u.u.txt == "b"