class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: D = None
        self.z: F = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.u: G = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.s: B = None
        self.z: F = None
        self.r: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.u: G = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.s: B = None
        self.z: F = None
        self.r: B = None
        self.txt = txt

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

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