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

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

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

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

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

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

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

i.z = k
i.x = d
i.p = f
k.v = c
k.r = f
b.t = j
b.x = i
g.w = f
e.p = c
e.u = b
j.z = k
j.v = g
d.z = k
d.x = i
d.p = f
a.p = i
a.u = b
c.z = k
c.x = i
c.p = f
f.w = g
assert f.w.w.w.w.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

i.z = k
i.x = d
i.p = f
k.v = c
k.r = f
b.t = j
b.x = i
g.w = f
e.p = c
e.u = b
j.z = k
j.v = g
d.z = k
d.x = i
d.p = f
a.p = i
a.u = b
c.z = k
c.x = i
c.p = f
f.w = g
assert f.w.w.w.w.w.w.w.w.w.w.txt == "f"