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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.v: D = None
        self.q: A = None
        self.r: G = None
        self.s: G = None
        self.txt = txt

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

l = A("l")
i = B("i")
n = C("n")
a = D("a")
e = E("e")
j = F("j")
k = G("k")
g = B("g")

l.x = j
i.t = a
n.v = k
n.q = e
n.o = j
a.t = i
e.x = n
j.y = i
j.p = k
j.r = k
j.s = k
j.v = a
j.q = l
k.r = i
k.u = i
g.t = a
assert i.t.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.v: D = None
        self.q: A = None
        self.r: G = None
        self.s: G = None
        self.txt = txt

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

l = A("l")
i = B("i")
n = C("n")
a = D("a")
e = E("e")
j = F("j")
k = G("k")
g = B("g")

l.x = j
i.t = a
n.v = k
n.q = e
n.o = j
a.t = i
e.x = n
j.y = i
j.p = k
j.r = k
j.s = k
j.v = a
j.q = l
k.r = i
k.u = i
g.t = a
assert i.t.t.t.t.t.t.t.t.txt == "i"