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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: C = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

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

i = A("i")
h = B("h")
j = C("j")
b = D("b")
m = E("m")
c = B("c")
n = D("n")

i.v = m
i.y = j
i.u = c
h.q = i
h.v = i
h.x = j
h.z = b
h.r = b
j.s = m
b.y = m
b.z = j
m.v = h
m.w = j
m.s = j
m.t = i
c.q = i
c.v = i
c.x = j
c.z = n
c.r = b
n.y = m
n.z = j
assert b.z.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: C = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

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

i = A("i")
h = B("h")
j = C("j")
b = D("b")
m = E("m")
c = B("c")
n = D("n")

i.v = m
i.y = j
i.u = c
h.q = i
h.v = i
h.x = j
h.z = b
h.r = b
j.s = m
b.y = m
b.z = j
m.v = h
m.w = j
m.s = j
m.t = i
c.q = i
c.v = i
c.x = j
c.z = n
c.r = b
n.y = m
n.z = j
assert b.z.s.t.txt == "i"