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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.w: E = None
        self.p: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.w: E = None
        self.p: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

d.o = i
d.q = e
d.t = l
d.z = m
m.v = f
m.u = h
m.w = h
m.p = i
m.s = g
i.q = g
e.o = f
e.t = l
e.s = h
h.s = i
h.x = e
h.v = d
h.z = d
f.v = m
f.u = h
f.w = h
f.p = i
f.s = d
g.o = i
g.q = e
g.t = l
g.z = m
l.o = f
l.t = e
l.s = h
assert i.q.q.o.s.t.t.o.txt == "f"