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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: B = None
        self.p: E = None
        self.o: B = None
        self.v: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: I = None
        self.t: A = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: E = None
        self.r: D = None
        self.t: A = None
        self.u: I = None
        self.z: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: B = None
        self.p: E = None
        self.o: B = None
        self.v: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: I = None
        self.t: A = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: E = None
        self.r: D = None
        self.t: A = None
        self.u: I = None
        self.z: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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