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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: J = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.u: C = None
        self.y: I = None
        self.w: H = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.q: C = None
        self.v: E = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: H = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: J = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.u: C = None
        self.y: I = None
        self.w: H = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.q: C = None
        self.v: E = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: H = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

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

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