class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.t: D = None
        self.q: B = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: G = None
        self.r: B = None
        self.p: E = None
        self.v: F = None
        self.s: C = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: A = None
        self.w: D = None
        self.o: D = None
        self.v: F = None
        self.txt = txt

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

d.z = n
c.t = j
m.u = n
m.y = j
m.t = j
m.z = j
m.q = c
m.r = k
j.x = d
j.q = k
j.r = c
j.p = l
j.v = h
j.s = b
j.u = i
l.r = n
h.w = c
h.x = j
k.x = i
k.r = d
k.w = j
k.o = j
k.v = h
n.z = d
i.x = k
i.r = d
i.w = j
i.o = j
i.v = h
b.u = n
b.y = j
b.t = j
b.z = j
b.q = c
b.r = k
assert j.q.r.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.t: D = None
        self.q: B = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: G = None
        self.r: B = None
        self.p: E = None
        self.v: F = None
        self.s: C = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: A = None
        self.w: D = None
        self.o: D = None
        self.v: F = None
        self.txt = txt

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

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