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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: C = None
        self.v: E = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

e = A("e")
f = B("f")
j = C("j")
b = D("b")
h = E("h")
i = F("i")
d = G("d")
a = H("a")
c = I("c")
g = J("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: C = None
        self.v: E = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

e = A("e")
f = B("f")
j = C("j")
b = D("b")
h = E("h")
i = F("i")
d = G("d")
a = H("a")
c = I("c")
g = J("g")

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