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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: H = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: J = None
        self.y: C = None
        self.o: J = None
        self.r: D = None
        self.p: B = None
        self.t: E = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: E = None
        self.r: D = None
        self.t: D = None
        self.q: H = None
        self.x: F = None
        self.v: I = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: H = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: J = None
        self.y: C = None
        self.o: J = None
        self.r: D = None
        self.p: B = None
        self.t: E = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: E = None
        self.r: D = None
        self.t: D = None
        self.q: H = None
        self.x: F = None
        self.v: I = None
        self.txt = txt

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

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