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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.p: D = None
        self.v: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: C = None
        self.v: B = None
        self.p: B = None
        self.txt = txt

d = A("d")
k = B("k")
i = C("i")
n = D("n")
m = E("m")
j = A("j")
b = D("b")
f = E("f")

d.x = k
d.y = i
d.r = b
d.t = n
d.s = j
k.x = f
i.s = f
i.z = f
i.v = d
n.u = b
n.p = b
n.r = f
n.w = f
n.v = i
m.u = j
m.z = i
m.v = k
m.p = k
j.x = k
j.y = i
j.r = b
j.t = b
j.s = d
b.u = n
b.p = n
b.r = m
b.w = m
b.v = i
f.u = j
f.z = i
f.v = k
f.p = k
assert b.r.p.x.p.x.p.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: C = None
        self.r: D = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.p: D = None
        self.v: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: C = None
        self.v: B = None
        self.p: B = None
        self.txt = txt

d = A("d")
k = B("k")
i = C("i")
n = D("n")
m = E("m")
j = A("j")
b = D("b")
f = E("f")

d.x = k
d.y = i
d.r = b
d.t = n
d.s = j
k.x = f
i.s = f
i.z = f
i.v = d
n.u = b
n.p = b
n.r = f
n.w = f
n.v = i
m.u = j
m.z = i
m.v = k
m.p = k
j.x = k
j.y = i
j.r = b
j.t = b
j.s = d
b.u = n
b.p = n
b.r = m
b.w = m
b.v = i
f.u = j
f.z = i
f.v = k
f.p = k
assert b.r.p.x.p.x.p.x.u.txt == "j"