class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: G = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: H = None
        self.p: J = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.w: H = None
        self.y: B = None
        self.p: H = None
        self.q: J = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: G = None
        self.p: F = None
        self.w: J = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: G = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: H = None
        self.p: J = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.w: H = None
        self.y: B = None
        self.p: H = None
        self.q: J = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: G = None
        self.p: F = None
        self.w: J = None
        self.v: E = None
        self.txt = txt

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

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

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