class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.z: E = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: J = None
        self.t: I = None
        self.q: I = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.z: J = None
        self.r: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.r: G = None
        self.p: J = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: J = None
        self.t: I = None
        self.q: I = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.z: J = None
        self.r: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.r: G = None
        self.p: J = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

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

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

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