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

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

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

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

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

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

m.z = k
m.o = g
g.r = i
g.t = k
i.v = g
d.w = m
l.z = m
l.p = m
l.o = g
l.t = i
b.w = m
h.z = m
h.p = m
h.o = g
h.t = i
k.w = m
e.z = m
e.p = m
e.o = g
e.t = i
assert i.v.t.w.o.r.v.t.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

m.z = k
m.o = g
g.r = i
g.t = k
i.v = g
d.w = m
l.z = m
l.p = m
l.o = g
l.t = i
b.w = m
h.z = m
h.p = m
h.o = g
h.t = i
k.w = m
e.z = m
e.p = m
e.o = g
e.t = i
assert i.v.t.w.o.r.v.t.w.z.txt == "k"