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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.q: B = None
        self.s: F = None
        self.r: C = None
        self.y: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.q: B = None
        self.s: F = None
        self.r: C = None
        self.y: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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