class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.o: C = None
        self.p: D = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: H = None
        self.z: G = None
        self.s: E = None
        self.p: H = None
        self.w: G = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: D = None
        self.z: B = None
        self.r: B = None
        self.v: H = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.txt = txt

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

c = A("c")
h = B("h")
n = C("n")
e = D("e")
l = E("l")
k = F("k")
g = G("g")
j = H("j")
f = H("f")
i = F("i")

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: H = None
        self.z: G = None
        self.s: E = None
        self.p: H = None
        self.w: G = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: D = None
        self.z: B = None
        self.r: B = None
        self.v: H = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.txt = txt

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

c = A("c")
h = B("h")
n = C("n")
e = D("e")
l = E("l")
k = F("k")
g = G("g")
j = H("j")
f = H("f")
i = F("i")

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