class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: D = None
        self.s: D = None
        self.t: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

a.x = j
a.u = j
a.p = g
a.s = g
a.t = m
b.u = j
b.w = m
j.x = l
g.o = b
g.r = b
g.p = f
f.z = g
f.s = g
f.r = m
f.p = j
l.x = j
l.u = j
l.p = g
l.s = g
l.t = m
m.o = b
m.r = b
m.p = f
assert j.x.s.p.txt == "f"