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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.z: G = None
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.r: C = None
        self.x: B = None
        self.v: A = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: J = None
        self.q: A = None
        self.r: F = None
        self.o: F = None
        self.y: A = None
        self.v: E = None
        self.w: F = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: G = None
        self.u: F = None
        self.z: E = None
        self.w: G = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: A = None
        self.r: A = None
        self.o: H = None
        self.v: I = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.z: G = None
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.r: C = None
        self.x: B = None
        self.v: A = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: J = None
        self.q: A = None
        self.r: F = None
        self.o: F = None
        self.y: A = None
        self.v: E = None
        self.w: F = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: G = None
        self.u: F = None
        self.z: E = None
        self.w: G = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: A = None
        self.r: A = None
        self.o: H = None
        self.v: I = None
        self.x: E = None
        self.txt = txt

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

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