class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: B = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.w: F = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: J = None
        self.o: H = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.y: I = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: J = None
        self.s: D = None
        self.v: B = None
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.t: C = None
        self.p: J = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.w: F = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: J = None
        self.o: H = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.y: I = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: J = None
        self.s: D = None
        self.v: B = None
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.t: C = None
        self.p: J = None
        self.w: A = None
        self.txt = txt

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

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

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