class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: A = None
        self.t: G = None
        self.z: I = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: I = None
        self.v: E = None
        self.s: G = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: D = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: H = None
        self.y: B = None
        self.t: F = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: A = None
        self.t: G = None
        self.z: I = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: I = None
        self.v: E = None
        self.s: G = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: D = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: H = None
        self.y: B = None
        self.t: F = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

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