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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: C = None
        self.s: E = None
        self.x: I = None
        self.o: G = None
        self.u: H = None
        self.z: I = None
        self.p: H = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.v: G = None
        self.s: H = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: J = None
        self.r: J = None
        self.z: C = None
        self.y: G = None
        self.s: G = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: C = None
        self.z: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: C = None
        self.s: E = None
        self.x: I = None
        self.o: G = None
        self.u: H = None
        self.z: I = None
        self.p: H = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.v: G = None
        self.s: H = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: J = None
        self.r: J = None
        self.z: C = None
        self.y: G = None
        self.s: G = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: C = None
        self.z: H = None
        self.txt = txt

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

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

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