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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.q: F = None
        self.x: F = None
        self.r: E = None
        self.o: E = None
        self.p: J = None
        self.u: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.x: E = None
        self.t: E = None
        self.z: H = None
        self.u: D = None
        self.v: E = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.q: F = None
        self.x: F = None
        self.r: E = None
        self.o: E = None
        self.p: J = None
        self.u: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.x: E = None
        self.t: E = None
        self.z: H = None
        self.u: D = None
        self.v: E = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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