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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.s: A = None
        self.y: C = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
e = D("e")
j = E("j")
d = B("d")
l = A("l")
m = D("m")

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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.s: A = None
        self.y: C = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
e = D("e")
j = E("j")
d = B("d")
l = A("l")
m = D("m")

b.p = j
b.s = j
b.z = e
b.x = e
b.r = d
k.v = d
k.t = i
i.v = k
i.t = m
e.t = b
j.u = d
j.q = l
j.s = b
j.y = i
d.v = k
d.t = i
l.p = j
l.s = j
l.z = m
l.x = m
l.r = d
m.t = b
assert i.t.t.z.t.x.t.txt == "b"