class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: G = None
        self.q: H = None
        self.r: B = None
        self.u: C = None
        self.o: F = None
        self.v: G = None
        self.p: F = None
        self.z: G = 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.v: G = None
        self.w: B = None
        self.z: D = None
        self.r: B = None
        self.o: I = None
        self.q: D = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.w: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.w: G = None
        self.r: F = None
        self.y: A = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.r: G = None
        self.q: E = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.z: A = None
        self.y: C = None
        self.t: A = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: H = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

f.t = l
f.q = l
f.s = d
f.v = d
f.z = d
f.r = a
f.u = h
f.o = m
f.p = m
a.v = f
h.v = d
h.w = a
h.r = a
h.z = n
h.q = n
h.o = k
h.s = m
n.z = e
n.r = h
n.w = d
n.p = m
e.o = a
e.x = n
e.w = d
e.r = m
e.y = f
e.z = k
m.p = e
m.q = e
m.v = n
m.w = n
m.r = d
d.p = n
d.w = n
d.s = n
d.x = l
d.y = i
d.v = m
d.o = f
l.x = a
l.s = h
l.y = h
l.z = f
l.t = f
l.u = d
k.t = d
k.w = l
k.p = a
i.u = f
assert d.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: G = None
        self.q: H = None
        self.r: B = None
        self.u: C = None
        self.o: F = None
        self.v: G = None
        self.p: F = None
        self.z: G = 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.v: G = None
        self.w: B = None
        self.z: D = None
        self.r: B = None
        self.o: I = None
        self.q: D = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.w: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.w: G = None
        self.r: F = None
        self.y: A = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.r: G = None
        self.q: E = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.z: A = None
        self.y: C = None
        self.t: A = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: H = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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