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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: G = None
        self.x: A = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: G = None
        self.z: I = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: G = None
        self.z: H = None
        self.u: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: F = None
        self.p: J = None
        self.x: J = None
        self.t: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: G = None
        self.x: A = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: G = None
        self.z: I = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: G = None
        self.z: H = None
        self.u: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: F = None
        self.p: J = None
        self.x: J = None
        self.t: G = None
        self.txt = txt

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

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

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