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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: H = None
        self.txt = txt

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

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

j.z = h
j.o = k
j.r = m
j.q = n
j.t = i
g.x = i
g.s = h
n.t = g
n.s = g
h.x = i
i.t = n
i.w = g
i.x = l
i.s = l
l.x = i
l.t = i
l.s = j
l.q = n
m.q = k
m.z = k
k.q = j
k.u = m
a.x = i
a.t = i
a.s = j
a.q = n
assert a.q.t.x.txt == "i"