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

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

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

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

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

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

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

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

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

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

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

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

b.v = j
b.r = h
b.z = n
j.v = g
j.q = g
j.p = b
j.x = b
j.r = b
f.v = n
i.z = b
i.p = l
n.s = b
n.y = e
n.w = e
n.t = f
n.u = i
l.z = b
l.p = i
e.s = b
e.y = n
e.w = n
e.t = f
e.u = h
h.z = b
h.p = l
g.v = j
g.q = j
g.p = b
g.x = b
g.r = b
assert l.p.p.p.p.p.p.z.txt == "b"