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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: C = None
        self.p: C = None
        self.v: B = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: E = None
        self.p: G = None
        self.r: J = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: A = None
        self.t: E = None
        self.o: H = None
        self.x: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: C = None
        self.p: C = None
        self.v: B = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: E = None
        self.p: G = None
        self.r: J = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: A = None
        self.t: E = None
        self.o: H = None
        self.x: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

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