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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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