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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.v: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: B = None
        self.r: J = None
        self.y: H = None
        self.s: I = None
        self.p: H = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: D = None
        self.s: G = None
        self.t: H = None
        self.r: A = None
        self.y: G = None
        self.w: H = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: H = None
        self.q: G = None
        self.y: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

m = A("m")
j = B("j")
d = C("d")
i = D("i")
n = E("n")
k = F("k")
a = G("a")
h = H("h")
b = I("b")
c = J("c")

m.u = k
m.v = n
j.s = h
j.r = c
d.y = i
d.x = i
d.t = j
d.v = j
i.o = j
i.x = j
i.t = j
i.r = c
i.y = h
i.p = h
i.s = b
i.w = a
n.p = b
n.o = i
n.s = a
n.y = a
n.t = h
n.w = h
n.r = m
n.x = c
k.x = b
k.w = h
k.y = h
k.q = a
k.r = j
a.x = k
h.x = k
b.x = d
c.x = d
c.o = d
c.u = n
c.t = n
c.s = h
c.p = m
c.q = m
c.r = b
assert a.x.r.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.v: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: B = None
        self.r: J = None
        self.y: H = None
        self.s: I = None
        self.p: H = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: D = None
        self.s: G = None
        self.t: H = None
        self.r: A = None
        self.y: G = None
        self.w: H = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: H = None
        self.q: G = None
        self.y: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

m = A("m")
j = B("j")
d = C("d")
i = D("i")
n = E("n")
k = F("k")
a = G("a")
h = H("h")
b = I("b")
c = J("c")

m.u = k
m.v = n
j.s = h
j.r = c
d.y = i
d.x = i
d.t = j
d.v = j
i.o = j
i.x = j
i.t = j
i.r = c
i.y = h
i.p = h
i.s = b
i.w = a
n.p = b
n.o = i
n.s = a
n.y = a
n.t = h
n.w = h
n.r = m
n.x = c
k.x = b
k.w = h
k.y = h
k.q = a
k.r = j
a.x = k
h.x = k
b.x = d
c.x = d
c.o = d
c.u = n
c.t = n
c.s = h
c.p = m
c.q = m
c.r = b
assert a.x.r.r.x.txt == "d"