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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: A = None
        self.s: E = None
        self.x: B = None
        self.q: A = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: B = None
        self.t: B = None
        self.x: A = None
        self.o: E = None
        self.y: I = None
        self.u: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: D = None
        self.p: D = None
        self.y: F = None
        self.z: H = None
        self.x: F = None
        self.u: H = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: I = None
        self.o: G = None
        self.w: G = None
        self.v: B = None
        self.y: B = None
        self.p: B = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: A = None
        self.s: E = None
        self.x: B = None
        self.q: A = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: B = None
        self.t: B = None
        self.x: A = None
        self.o: E = None
        self.y: I = None
        self.u: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: D = None
        self.p: D = None
        self.y: F = None
        self.z: H = None
        self.x: F = None
        self.u: H = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: I = None
        self.o: G = None
        self.w: G = None
        self.v: B = None
        self.y: B = None
        self.p: B = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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