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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

a = A("a")
d = B("d")
e = C("e")
b = D("b")
l = E("l")
i = F("i")
g = G("g")
m = H("m")
h = I("h")
n = J("n")

a.y = l
d.p = a
e.r = d
e.w = l
e.q = a
e.u = m
e.z = g
b.r = m
b.v = i
l.t = m
l.x = b
l.q = g
l.p = e
l.w = e
l.r = d
l.o = n
i.u = a
i.t = l
i.p = l
i.o = b
g.r = b
g.o = h
m.u = a
m.t = i
m.q = e
h.u = i
n.p = b
n.r = m
assert i.u.y.p.u.q.q.y.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

a = A("a")
d = B("d")
e = C("e")
b = D("b")
l = E("l")
i = F("i")
g = G("g")
m = H("m")
h = I("h")
n = J("n")

a.y = l
d.p = a
e.r = d
e.w = l
e.q = a
e.u = m
e.z = g
b.r = m
b.v = i
l.t = m
l.x = b
l.q = g
l.p = e
l.w = e
l.r = d
l.o = n
i.u = a
i.t = l
i.p = l
i.o = b
g.r = b
g.o = h
m.u = a
m.t = i
m.q = e
h.u = i
n.p = b
n.r = m
assert i.u.y.p.u.q.q.y.o.p.txt == "b"