class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: E = None
        self.o: F = None
        self.x: D = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

c = A("c")
n = B("n")
k = C("k")
f = D("f")
h = E("h")
b = F("b")
a = G("a")
l = F("l")

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

c = A("c")
n = B("n")
k = C("k")
f = D("f")
h = E("h")
b = F("b")
a = G("a")
l = F("l")

c.q = b
c.o = b
c.u = h
c.s = h
c.x = f
n.y = k
n.u = k
n.z = c
n.s = f
n.p = f
k.t = h
k.v = h
k.r = n
f.x = n
f.s = c
f.v = k
f.r = k
f.o = k
h.o = l
h.v = l
h.q = c
h.t = k
h.u = k
b.y = a
b.z = l
a.p = f
l.y = a
l.z = b
assert b.z.z.z.z.y.p.txt == "f"