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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: H = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: J = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.s: G = None
        self.t: I = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
b = C("b")
e = D("e")
g = E("g")
i = F("i")
d = G("d")
l = H("l")
h = I("h")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: H = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: J = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.s: G = None
        self.t: I = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
b = C("b")
e = D("e")
g = E("g")
i = F("i")
d = G("d")
l = H("l")
h = I("h")
f = J("f")

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