class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: G = None
        self.z: H = None
        self.x: E = None
        self.p: B = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: H = None
        self.o: B = None
        self.u: F = None
        self.w: G = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: G = None
        self.y: E = None
        self.o: E = None
        self.z: H = None
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: B = None
        self.y: B = None
        self.q: B = None
        self.r: C = None
        self.s: F = None
        self.p: C = None
        self.x: E = None
        self.txt = txt

n = A("n")
i = B("i")
j = C("j")
g = D("g")
c = E("c")
k = F("k")
e = G("e")
a = H("a")

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: H = None
        self.o: B = None
        self.u: F = None
        self.w: G = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: G = None
        self.y: E = None
        self.o: E = None
        self.z: H = None
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: B = None
        self.y: B = None
        self.q: B = None
        self.r: C = None
        self.s: F = None
        self.p: C = None
        self.x: E = None
        self.txt = txt

n = A("n")
i = B("i")
j = C("j")
g = D("g")
c = E("c")
k = F("k")
e = G("e")
a = H("a")

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