class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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