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

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

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.o: C = None
        self.v: B = None
        self.x: E = None
        self.txt = txt

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

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

b.z = f
b.t = j
b.y = j
f.r = e
e.z = j
e.p = c
e.v = m
e.r = n
e.x = f
n.p = c
n.u = f
n.v = f
n.o = e
n.x = m
h.r = e
h.s = e
m.r = e
m.s = e
j.p = n
j.u = f
j.v = f
j.o = e
j.x = m
c.p = n
c.u = f
c.v = f
c.o = e
c.x = m
assert j.x.r.r.v.r.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.o: C = None
        self.v: B = None
        self.x: E = None
        self.txt = txt

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

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

b.z = f
b.t = j
b.y = j
f.r = e
e.z = j
e.p = c
e.v = m
e.r = n
e.x = f
n.p = c
n.u = f
n.v = f
n.o = e
n.x = m
h.r = e
h.s = e
m.r = e
m.s = e
j.p = n
j.u = f
j.v = f
j.o = e
j.x = m
c.p = n
c.u = f
c.v = f
c.o = e
c.x = m
assert j.x.r.r.v.r.v.s.txt == "e"