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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.z: A = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.p: A = None
        self.q: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.p: C = None
        self.u: B = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: B = None
        self.z: A = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.p: A = None
        self.q: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.p: C = None
        self.u: B = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

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

f.q = i
k.v = e
k.z = j
k.x = i
l.s = k
l.r = k
l.z = f
l.y = i
l.u = j
d.u = h
d.s = h
d.q = h
d.w = h
d.p = i
d.y = a
h.w = j
h.q = j
h.z = j
j.v = k
j.u = k
j.s = i
j.p = l
j.x = f
j.r = d
e.q = i
b.s = k
b.r = k
b.z = e
b.y = e
b.u = j
a.u = h
a.s = h
a.q = h
a.w = h
a.p = e
a.y = d
i.q = e
assert i.q.q.q.q.q.q.q.q.q.q.txt == "i"