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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
i = C("i")
a = D("a")
n = E("n")
f = F("f")
c = G("c")
h = E("h")
m = G("m")
d = F("d")

g.q = i
e.z = i
e.u = m
i.y = n
i.r = m
i.x = g
i.s = d
i.q = a
a.w = g
a.t = g
a.p = g
a.v = c
a.s = c
n.y = e
n.o = e
n.t = g
n.q = d
f.u = i
f.r = c
c.u = i
c.r = f
c.q = e
c.s = e
c.t = h
h.y = e
h.o = e
h.t = g
h.q = f
m.u = i
m.r = d
m.q = e
m.s = e
m.t = n
d.u = i
d.r = m
assert i.q.s.u.x.q.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
i = C("i")
a = D("a")
n = E("n")
f = F("f")
c = G("c")
h = E("h")
m = G("m")
d = F("d")

g.q = i
e.z = i
e.u = m
i.y = n
i.r = m
i.x = g
i.s = d
i.q = a
a.w = g
a.t = g
a.p = g
a.v = c
a.s = c
n.y = e
n.o = e
n.t = g
n.q = d
f.u = i
f.r = c
c.u = i
c.r = f
c.q = e
c.s = e
c.t = h
h.y = e
h.o = e
h.t = g
h.q = f
m.u = i
m.r = d
m.q = e
m.s = e
m.t = n
d.u = i
d.r = m
assert i.q.s.u.x.q.s.r.txt == "m"