class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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