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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.r: H = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.u: C = None
        self.w: E = None
        self.r: D = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.r: H = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: D = None
        self.u: C = None
        self.w: E = None
        self.r: D = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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