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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.p: C = None
        self.x: E = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.w: E = None
        self.v: B = None
        self.o: G = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.z: A = None
        self.w: E = None
        self.v: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.p: C = None
        self.x: E = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.w: E = None
        self.v: B = None
        self.o: G = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.z: A = None
        self.w: E = None
        self.v: A = None
        self.txt = txt

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

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