class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.v: A = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: G = None
        self.txt = txt

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

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

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