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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.x: B = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.x: B = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

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

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

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

f.z = g
f.s = h
f.x = k
f.t = l
f.o = i
m.v = f
m.t = f
m.o = g
m.q = h
m.p = h
i.w = h
i.z = m
i.x = m
i.v = g
i.o = l
g.s = f
l.y = g
k.z = g
k.s = m
k.x = f
k.t = l
k.o = i
b.y = g
h.v = k
h.o = g
h.q = m
h.p = m
h.t = f
assert h.t.z.s.t.y.s.o.txt == "i"