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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
j = C("j")
g = D("g")
e = E("e")
l = A("l")

f.t = e
f.u = l
f.v = j
f.o = j
f.w = g
b.z = e
j.y = f
j.t = g
g.r = b
g.s = j
g.o = j
g.p = e
e.o = b
e.p = j
l.t = e
l.u = f
l.v = j
l.o = j
l.w = g
assert l.v.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: A = None
        self.v: C = None
        self.o: C = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
j = C("j")
g = D("g")
e = E("e")
l = A("l")

f.t = e
f.u = l
f.v = j
f.o = j
f.w = g
b.z = e
j.y = f
j.t = g
g.r = b
g.s = j
g.o = j
g.p = e
e.o = b
e.p = j
l.t = e
l.u = f
l.v = j
l.o = j
l.w = g
assert l.v.t.r.txt == "b"