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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
h = C("h")
l = D("l")
m = E("m")
c = D("c")
k = E("k")
i = A("i")
g = A("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
h = C("h")
l = D("l")
m = E("m")
c = D("c")
k = E("k")
i = A("i")
g = A("g")

e.r = f
e.s = f
e.u = k
e.x = c
e.t = i
f.v = h
f.o = g
f.z = k
h.z = f
h.s = e
h.v = i
h.p = l
l.y = m
l.w = c
l.r = i
m.r = h
c.y = k
c.w = l
c.r = i
k.r = h
i.r = f
i.s = f
i.u = k
i.x = c
i.t = e
g.r = f
g.s = f
g.u = k
g.x = c
g.t = e
assert e.t.u.r.p.y.r.z.v.txt == "h"