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

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

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: D = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: I = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: J = None
        self.r: H = None
        self.p: H = None
        self.w: J = None
        self.o: E = None
        self.y: E = None
        self.q: E = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: F = None
        self.z: G = None
        self.p: D = None
        self.u: G = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: D = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: I = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: J = None
        self.r: H = None
        self.p: H = None
        self.w: J = None
        self.o: E = None
        self.y: E = None
        self.q: E = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: F = None
        self.z: G = None
        self.p: D = None
        self.u: G = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.txt = txt

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

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