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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: G = None
        self.s: C = None
        self.y: C = None
        self.q: F = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

i = A("i")
j = B("j")
e = C("e")
h = D("h")
g = E("g")
n = F("n")
m = G("m")

i.s = m
i.w = n
i.v = g
j.o = h
j.u = e
j.s = m
e.x = n
h.v = m
h.p = m
h.s = e
h.y = e
h.o = e
h.q = n
h.w = g
g.s = h
g.u = h
g.z = i
g.v = i
n.v = j
n.s = e
n.x = g
n.w = m
n.q = h
n.u = i
m.x = h
m.u = i
assert n.s.x.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: G = None
        self.s: C = None
        self.y: C = None
        self.q: F = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

i = A("i")
j = B("j")
e = C("e")
h = D("h")
g = E("g")
n = F("n")
m = G("m")

i.s = m
i.w = n
i.v = g
j.o = h
j.u = e
j.s = m
e.x = n
h.v = m
h.p = m
h.s = e
h.y = e
h.o = e
h.q = n
h.w = g
g.s = h
g.u = h
g.z = i
g.v = i
n.v = j
n.s = e
n.x = g
n.w = m
n.q = h
n.u = i
m.x = h
m.u = i
assert n.s.x.q.q.q.txt == "h"