class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.s: A = None
        self.p: H = None
        self.w: G = None
        self.o: D = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: H = None
        self.q: G = None
        self.v: E = None
        self.z: B = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.u: F = None
        self.z: B = None
        self.w: A = None
        self.t: H = None
        self.txt = txt

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

f = A("f")
l = B("l")
k = C("k")
i = D("i")
g = E("g")
e = F("e")
b = G("b")
a = H("a")
d = F("d")

f.t = b
l.z = i
k.t = g
k.q = g
k.v = l
k.s = f
k.p = a
k.w = b
k.o = i
k.u = i
i.o = k
i.s = a
i.q = b
i.v = g
i.u = g
i.z = l
i.r = d
g.o = l
g.u = l
g.z = b
e.r = f
e.x = d
e.o = l
b.q = g
b.v = i
b.u = d
b.z = l
b.w = f
b.t = a
a.z = l
a.s = l
a.q = l
d.r = f
d.x = e
d.o = l
assert l.z.z.z.s.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.s: A = None
        self.p: H = None
        self.w: G = None
        self.o: D = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: H = None
        self.q: G = None
        self.v: E = None
        self.z: B = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: F = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.u: F = None
        self.z: B = None
        self.w: A = None
        self.t: H = None
        self.txt = txt

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

f = A("f")
l = B("l")
k = C("k")
i = D("i")
g = E("g")
e = F("e")
b = G("b")
a = H("a")
d = F("d")

f.t = b
l.z = i
k.t = g
k.q = g
k.v = l
k.s = f
k.p = a
k.w = b
k.o = i
k.u = i
i.o = k
i.s = a
i.q = b
i.v = g
i.u = g
i.z = l
i.r = d
g.o = l
g.u = l
g.z = b
e.r = f
e.x = d
e.o = l
b.q = g
b.v = i
b.u = d
b.z = l
b.w = f
b.t = a
a.z = l
a.s = l
a.q = l
d.r = f
d.x = e
d.o = l
assert l.z.z.z.s.z.z.txt == "i"