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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: E = None
        self.x: E = None
        self.u: A = None
        self.w: C = None
        self.v: G = None
        self.p: E = None
        self.z: D = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

f.z = i
f.p = e
f.u = j
f.t = m
f.r = n
l.r = i
l.s = j
l.v = f
l.t = n
m.o = d
m.t = c
m.r = b
d.z = l
b.x = c
b.v = j
n.r = i
n.t = b
n.x = b
n.p = b
n.o = b
n.u = f
n.w = m
n.v = c
n.z = d
n.q = e
c.r = b
c.v = f
i.p = c
e.v = d
e.w = c
e.r = c
j.z = c
j.s = d
assert d.z.r.p.r.x.r.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: I = None
        self.u: J = None
        self.t: C = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: E = None
        self.x: E = None
        self.u: A = None
        self.w: C = None
        self.v: G = None
        self.p: E = None
        self.z: D = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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