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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.t: E = None
        self.u: E = None
        self.r: G = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: A = None
        self.s: A = None
        self.o: A = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

e = A("e")
c = B("c")
n = C("n")
a = D("a")
b = E("b")
d = F("d")
h = G("h")
i = H("i")
k = D("k")

e.u = i
e.p = i
c.w = i
c.s = b
c.t = b
c.u = b
c.r = h
c.x = e
n.u = d
n.w = d
n.z = e
n.s = e
n.o = e
n.x = k
a.u = n
a.x = n
b.z = e
b.p = e
d.u = e
d.s = i
h.q = e
h.t = n
i.u = h
i.o = k
k.u = n
k.x = n
assert i.u.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.t: E = None
        self.u: E = None
        self.r: G = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: A = None
        self.s: A = None
        self.o: A = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

e = A("e")
c = B("c")
n = C("n")
a = D("a")
b = E("b")
d = F("d")
h = G("h")
i = H("i")
k = D("k")

e.u = i
e.p = i
c.w = i
c.s = b
c.t = b
c.u = b
c.r = h
c.x = e
n.u = d
n.w = d
n.z = e
n.s = e
n.o = e
n.x = k
a.u = n
a.x = n
b.z = e
b.p = e
d.u = e
d.s = i
h.q = e
h.t = n
i.u = h
i.o = k
k.u = n
k.x = n
assert i.u.q.p.txt == "i"