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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: E = None
        self.z: G = None
        self.q: F = None
        self.s: A = None
        self.o: G = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.y: E = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

c = A("c")
l = B("l")
d = C("d")
j = D("j")
a = E("a")
f = F("f")
n = G("n")
g = A("g")
b = F("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: E = None
        self.z: G = None
        self.q: F = None
        self.s: A = None
        self.o: G = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.y: E = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

c = A("c")
l = B("l")
d = C("d")
j = D("j")
a = E("a")
f = F("f")
n = G("n")
g = A("g")
b = F("b")

c.t = l
l.w = d
l.z = j
l.t = a
d.q = n
j.p = b
j.w = b
j.t = a
j.z = n
j.o = n
j.q = f
j.s = g
a.t = d
a.u = d
a.v = n
f.u = a
f.y = a
f.r = a
f.s = d
f.o = n
n.w = d
n.q = d
n.x = l
n.o = g
n.t = g
g.t = l
b.u = a
b.y = a
b.r = a
b.s = d
b.o = n
assert f.u.v.w.q.x.z.w.s.q.txt == "n"