class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: D = None
        self.t: B = None
        self.r: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: F = None
        self.o: D = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.o: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: C = None
        self.y: E = None
        self.s: E = None
        self.w: J = None
        self.r: H = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.u: I = None
        self.x: I = None
        self.t: C = None
        self.s: G = None
        self.q: E = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: F = None
        self.o: D = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.o: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: C = None
        self.y: E = None
        self.s: E = None
        self.w: J = None
        self.r: H = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.u: I = None
        self.x: I = None
        self.t: C = None
        self.s: G = None
        self.q: E = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

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