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

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

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

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

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

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

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

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

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

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

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

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

m.o = l
m.r = l
m.v = h
m.q = k
g.y = a
g.w = h
g.z = d
g.s = l
b.s = h
b.r = k
b.y = k
b.q = a
h.t = d
h.s = d
h.z = b
l.o = h
l.v = h
l.q = d
d.o = h
d.v = h
d.q = l
k.o = l
k.r = l
k.v = h
k.q = m
a.y = g
a.w = h
a.z = l
a.s = d
assert d.v.z.q.s.q.q.txt == "d"