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

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

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

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

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

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

k.u = g
k.r = i
m.z = k
m.y = g
m.p = h
g.u = b
g.v = d
g.q = m
g.z = j
i.z = e
i.u = h
a.r = b
a.u = k
a.v = e
a.t = d
b.z = k
b.y = g
b.p = i
d.r = j
d.u = k
d.v = e
d.t = e
e.r = j
e.u = k
e.v = d
e.t = a
h.z = a
h.u = i
j.z = k
j.y = g
j.p = h
assert h.z.u.r.z.u.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

k.u = g
k.r = i
m.z = k
m.y = g
m.p = h
g.u = b
g.v = d
g.q = m
g.z = j
i.z = e
i.u = h
a.r = b
a.u = k
a.v = e
a.t = d
b.z = k
b.y = g
b.p = i
d.r = j
d.u = k
d.v = e
d.t = e
e.r = j
e.u = k
e.v = d
e.t = a
h.z = a
h.u = i
j.z = k
j.y = g
j.p = h
assert h.z.u.r.z.u.u.v.txt == "d"