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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.s: C = None
        self.q: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: J = None
        self.w: H = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: C = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: A = None
        self.r: F = None
        self.x: C = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.u: F = None
        self.o: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.w: D = None
        self.z: C = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.s: C = None
        self.q: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: J = None
        self.w: H = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: C = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: A = None
        self.r: F = None
        self.x: C = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.u: F = None
        self.o: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.w: D = None
        self.z: C = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

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

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