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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: B = None
        self.z: G = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: B = None
        self.z: G = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.txt = txt

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

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

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