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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: A = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: A = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

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

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