class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: B = None
        self.x: E = None
        self.r: I = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: D = None
        self.v: J = None
        self.r: G = None
        self.t: J = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.z: G = None
        self.x: A = None
        self.u: C = None
        self.p: E = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: F = None
        self.u: J = None
        self.r: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.p: I = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: D = None
        self.v: J = None
        self.r: G = None
        self.t: J = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.z: G = None
        self.x: A = None
        self.u: C = None
        self.p: E = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: F = None
        self.u: J = None
        self.r: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.p: I = None
        self.y: D = None
        self.txt = txt

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

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