class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.q: C = None
        self.y: F = None
        self.z: G = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.v: B = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

h = A("h")
a = B("a")
g = C("g")
j = D("j")
n = E("n")
b = F("b")
c = G("c")
e = D("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.v: B = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

h = A("h")
a = B("a")
g = C("g")
j = D("j")
n = E("n")
b = F("b")
c = G("c")
e = D("e")

h.p = c
h.z = c
h.s = n
h.q = g
h.y = b
h.x = a
h.w = a
a.q = b
a.u = n
a.s = c
a.p = c
a.o = c
g.v = h
g.r = n
j.q = n
j.z = b
j.v = a
j.r = a
j.s = g
n.v = e
n.x = g
n.u = g
n.w = h
b.x = h
c.w = e
e.q = n
e.z = b
e.v = a
e.r = a
e.s = g
assert a.q.x.s.v.s.v.s.txt == "n"