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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.x: I = None
        self.v: I = None
        self.s: F = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: I = None
        self.q: D = None
        self.o: F = None
        self.x: G = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: G = None
        self.x: B = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: I = None
        self.t: I = None
        self.q: B = None
        self.y: F = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.x: I = None
        self.v: I = None
        self.s: F = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: I = None
        self.q: D = None
        self.o: F = None
        self.x: G = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: G = None
        self.x: B = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: I = None
        self.t: I = None
        self.q: B = None
        self.y: F = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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