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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: I = None
        self.u: A = None
        self.p: H = None
        self.y: I = None
        self.q: B = None
        self.t: H = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: J = None
        self.o: H = None
        self.r: D = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: I = None
        self.u: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: I = None
        self.u: A = None
        self.p: H = None
        self.y: I = None
        self.q: B = None
        self.t: H = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: J = None
        self.o: H = None
        self.r: D = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: I = None
        self.u: I = None
        self.txt = txt

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

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