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

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

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

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

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

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

g.r = f
g.z = f
g.p = c
g.s = l
j.p = k
j.o = i
j.x = c
j.t = g
k.z = i
m.t = l
m.r = i
f.z = k
f.s = m
f.t = i
c.r = f
c.z = f
c.p = g
c.s = h
l.t = m
l.r = f
a.p = k
a.o = f
a.x = c
a.t = c
h.t = m
h.r = i
i.z = k
i.s = h
i.t = f
assert i.z.z.z.z.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: A = None
        self.s: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

g.r = f
g.z = f
g.p = c
g.s = l
j.p = k
j.o = i
j.x = c
j.t = g
k.z = i
m.t = l
m.r = i
f.z = k
f.s = m
f.t = i
c.r = f
c.z = f
c.p = g
c.s = h
l.t = m
l.r = f
a.p = k
a.o = f
a.x = c
a.t = c
h.t = m
h.r = i
i.z = k
i.s = h
i.t = f
assert i.z.z.z.z.t.t.txt == "i"