class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: D = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: G = None
        self.s: A = None
        self.p: H = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.o: G = None
        self.q: H = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: C = None
        self.w: I = None
        self.o: J = None
        self.u: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: C = None
        self.y: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.p: G = None
        self.y: C = None
        self.q: E = None
        self.w: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: I = None
        self.w: G = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: D = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: G = None
        self.s: A = None
        self.p: H = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.o: G = None
        self.q: H = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: C = None
        self.w: I = None
        self.o: J = None
        self.u: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: C = None
        self.y: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.p: G = None
        self.y: C = None
        self.q: E = None
        self.w: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: I = None
        self.w: G = None
        self.s: G = None
        self.txt = txt

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

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