class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.w: F = None
        self.x: D = None
        self.t: I = None
        self.v: C = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.v: G = None
        self.z: G = None
        self.y: I = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: D = None
        self.t: F = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: J = None
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: H = None
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.v: G = None
        self.z: G = None
        self.y: I = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: D = None
        self.t: F = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: J = None
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: H = None
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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