class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: F = None
        self.x: C = None
        self.q: B = None
        self.o: F = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.q: B = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.s: H = None
        self.w: B = None
        self.q: B = None
        self.o: A = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: E = None
        self.r: E = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: H = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.u: G = None
        self.q: G = None
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.q: B = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.s: H = None
        self.w: B = None
        self.q: B = None
        self.o: A = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: E = None
        self.r: E = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: H = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.u: G = None
        self.q: G = None
        self.o: C = None
        self.txt = txt

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

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