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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

d.o = j
b.z = m
b.r = i
b.s = i
b.q = d
g.q = f
l.v = a
l.t = b
i.y = d
i.s = j
i.u = a
i.z = l
i.q = f
a.q = b
h.z = m
h.r = i
h.s = i
h.q = d
j.v = g
j.t = b
m.z = h
m.r = i
m.s = i
m.q = d
f.z = m
f.r = i
f.s = i
f.q = d
assert g.q.q.o.t.z.txt == "m"