class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: E = None
        self.x: F = None
        self.t: H = None
        self.s: J = None
        self.u: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.r: C = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: J = None
        self.s: E = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.y: F = None
        self.q: A = None
        self.t: C = None
        self.v: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: H = None
        self.o: I = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.r: C = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: J = None
        self.s: E = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.y: F = None
        self.q: A = None
        self.t: C = None
        self.v: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: H = None
        self.o: I = None
        self.y: D = None
        self.txt = txt

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

d.r = n
d.s = n
d.p = h
d.x = l
d.t = b
d.u = b
i.q = k
i.x = h
i.s = e
i.r = e
i.t = f
i.v = f
i.y = f
e.r = h
c.u = e
h.z = i
h.o = b
h.r = e
h.x = f
l.t = k
l.p = c
k.o = d
k.x = n
k.s = h
k.q = f
b.u = c
b.x = h
b.y = l
b.q = d
b.t = e
b.v = k
f.r = c
n.v = i
n.t = b
n.o = f
n.y = c
assert e.r.x.r.txt == "c"