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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.p: C = None
        self.x: C = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: D = None
        self.w: C = None
        self.txt = txt

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

h = A("h")
j = B("j")
a = C("a")
f = D("f")
c = E("c")
k = F("k")
e = E("e")
l = E("l")
b = B("b")
g = C("g")

h.q = a
h.v = e
j.v = b
a.z = l
a.y = h
a.u = h
a.p = g
a.x = g
a.t = f
f.u = g
f.o = g
f.q = g
f.v = h
f.t = k
f.x = b
c.t = k
c.x = f
c.w = a
k.q = f
k.z = f
k.y = f
k.s = h
e.t = k
e.x = f
e.w = g
l.t = k
l.x = f
l.w = a
b.v = j
g.z = e
g.y = h
g.u = h
g.p = a
g.x = a
g.t = f
assert f.x.v.v.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.p: C = None
        self.x: C = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: D = None
        self.w: C = None
        self.txt = txt

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

h = A("h")
j = B("j")
a = C("a")
f = D("f")
c = E("c")
k = F("k")
e = E("e")
l = E("l")
b = B("b")
g = C("g")

h.q = a
h.v = e
j.v = b
a.z = l
a.y = h
a.u = h
a.p = g
a.x = g
a.t = f
f.u = g
f.o = g
f.q = g
f.v = h
f.t = k
f.x = b
c.t = k
c.x = f
c.w = a
k.q = f
k.z = f
k.y = f
k.s = h
e.t = k
e.x = f
e.w = g
l.t = k
l.x = f
l.w = a
b.v = j
g.z = e
g.y = h
g.u = h
g.p = a
g.x = a
g.t = f
assert f.x.v.v.v.v.v.v.v.v.v.txt == "j"