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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
m = C("m")
a = D("a")
d = E("d")
j = F("j")
e = G("e")
k = G("k")
i = C("i")
n = F("n")

g.x = k
g.p = d
g.q = i
b.v = a
b.s = n
m.s = b
m.x = a
a.w = k
a.u = d
a.y = i
a.o = g
d.x = n
d.q = m
d.w = m
d.r = g
d.y = g
j.s = d
j.r = d
j.u = a
j.t = b
j.w = n
e.v = g
e.x = d
k.v = g
k.x = d
i.s = b
i.x = a
n.s = d
n.r = d
n.u = a
n.t = b
n.w = j
assert a.y.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
m = C("m")
a = D("a")
d = E("d")
j = F("j")
e = G("e")
k = G("k")
i = C("i")
n = F("n")

g.x = k
g.p = d
g.q = i
b.v = a
b.s = n
m.s = b
m.x = a
a.w = k
a.u = d
a.y = i
a.o = g
d.x = n
d.q = m
d.w = m
d.r = g
d.y = g
j.s = d
j.r = d
j.u = a
j.t = b
j.w = n
e.v = g
e.x = d
k.v = g
k.x = d
i.s = b
i.x = a
n.s = d
n.r = d
n.u = a
n.t = b
n.w = j
assert a.y.s.s.txt == "n"