class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.o: E = None
        self.y: F = None
        self.z: H = None
        self.r: F = None
        self.q: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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