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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: B = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.v: F = None
        self.s: G = None
        self.r: F = None
        self.z: C = None
        self.p: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: B = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.v: F = None
        self.s: G = None
        self.r: F = None
        self.z: C = None
        self.p: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

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

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