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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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

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

m.u = j
m.x = j
m.z = f
m.r = c
m.w = k
f.t = h
f.q = e
f.v = k
j.s = m
j.p = k
c.v = d
c.y = m
c.t = m
n.u = e
n.y = m
e.s = m
e.p = k
h.u = e
h.y = m
k.t = h
k.q = j
k.v = f
d.v = c
d.y = m
d.t = m
assert c.v.t.r.y.r.v.v.t.txt == "m"