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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: F = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: F = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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