class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: A = None
        self.v: B = None
        self.y: F = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.y: A = None
        self.s: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: A = None
        self.v: B = None
        self.y: F = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.y: A = None
        self.s: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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