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

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

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

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

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

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

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

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

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

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

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

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

h.u = l
h.s = i
h.r = m
f.x = l
f.r = l
f.u = i
f.w = m
l.q = d
l.z = d
l.y = h
l.v = f
i.u = l
i.v = l
m.o = d
d.u = l
d.v = l
g.x = l
g.r = l
g.u = i
g.w = k
k.o = i
assert m.o.v.y.r.o.u.z.v.txt == "l"