class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.t: I = None
        self.y: B = None
        self.u: E = None
        self.o: F = None
        self.q: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.p: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.z: G = None
        self.r: F = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: I = None
        self.q: E = None
        self.x: A = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: C = None
        self.x: A = None
        self.t: E = None
        self.w: B = None
        self.s: H = None
        self.o: E = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

d = A("d")
j = B("j")
k = C("k")
e = D("e")
n = E("n")
m = F("m")
h = G("h")
f = H("f")
a = I("a")
g = J("g")

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.p: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.z: G = None
        self.r: F = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: I = None
        self.q: E = None
        self.x: A = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: C = None
        self.x: A = None
        self.t: E = None
        self.w: B = None
        self.s: H = None
        self.o: E = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

d = A("d")
j = B("j")
k = C("k")
e = D("e")
n = E("n")
m = F("m")
h = G("h")
f = H("f")
a = I("a")
g = J("g")

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