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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: B = None
        self.y: I = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: B = None
        self.z: D = None
        self.o: C = None
        self.q: D = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: I = None
        self.u: G = None
        self.x: D = None
        self.y: B = None
        self.t: B = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: B = None
        self.y: I = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: B = None
        self.z: D = None
        self.o: C = None
        self.q: D = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: I = None
        self.u: G = None
        self.x: D = None
        self.y: B = None
        self.t: B = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

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