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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.w: C = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

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

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

b.r = f
d.v = j
d.u = m
d.p = b
d.z = h
g.y = d
g.w = m
g.s = h
g.u = h
g.x = f
f.u = k
f.r = g
f.w = g
f.p = l
f.v = l
l.y = f
h.u = m
h.r = e
h.w = e
h.p = l
h.v = l
m.y = f
k.y = f
j.v = d
j.u = l
j.p = b
j.z = h
e.y = d
e.w = m
e.s = f
e.u = f
e.x = f
assert m.y.v.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.w: C = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

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

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

b.r = f
d.v = j
d.u = m
d.p = b
d.z = h
g.y = d
g.w = m
g.s = h
g.u = h
g.x = f
f.u = k
f.r = g
f.w = g
f.p = l
f.v = l
l.y = f
h.u = m
h.r = e
h.w = e
h.p = l
h.v = l
m.y = f
k.y = f
j.v = d
j.u = l
j.p = b
j.z = h
e.y = d
e.w = m
e.s = f
e.u = f
e.x = f
assert m.y.v.y.u.txt == "k"