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

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

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: B = None
        self.q: C = None
        self.z: F = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: J = None
        self.r: C = None
        self.q: B = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: J = None
        self.x: C = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

g = A("g")
b = B("b")
h = C("h")
j = D("j")
i = E("i")
f = F("f")
m = G("m")
l = H("l")
n = I("n")
k = J("k")

g.s = j
g.p = i
b.w = l
b.p = i
h.s = f
j.x = k
j.r = b
j.q = h
j.z = f
j.t = n
i.z = n
i.p = k
i.x = k
i.r = h
i.q = b
f.y = l
m.t = i
m.u = k
l.t = g
l.w = m
n.r = i
n.o = i
n.v = k
n.x = h
n.q = h
k.s = l
assert i.r.s.y.t.s.q.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: B = None
        self.q: C = None
        self.z: F = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: J = None
        self.r: C = None
        self.q: B = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: J = None
        self.x: C = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

g = A("g")
b = B("b")
h = C("h")
j = D("j")
i = E("i")
f = F("f")
m = G("m")
l = H("l")
n = I("n")
k = J("k")

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