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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.o: D = None
        self.q: A = None
        self.x: A = None
        self.z: G = None
        self.w: F = None
        self.v: B = None
        self.txt = txt

n = A("n")
d = B("d")
h = C("h")
g = D("g")
e = E("e")
i = F("i")
l = G("l")
k = H("k")

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.o: D = None
        self.q: A = None
        self.x: A = None
        self.z: G = None
        self.w: F = None
        self.v: B = None
        self.txt = txt

n = A("n")
d = B("d")
h = C("h")
g = D("g")
e = E("e")
i = F("i")
l = G("l")
k = H("k")

n.o = g
n.w = i
n.y = d
n.s = e
n.x = k
d.x = n
d.u = h
d.w = l
h.s = n
h.u = i
h.y = i
g.o = e
g.u = n
g.x = k
g.q = l
g.p = i
g.r = d
e.t = g
e.o = l
e.s = l
e.y = i
e.x = d
i.s = e
i.z = l
i.q = d
i.u = g
l.q = n
l.y = g
l.o = i
k.u = g
k.p = g
k.o = g
k.q = n
k.x = n
k.z = l
k.w = i
k.v = d
assert i.u.u.w.txt == "i"