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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: B = None
        self.x: A = None
        self.y: H = None
        self.s: C = None
        self.o: C = None
        self.u: H = None
        self.q: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.u: B = None
        self.r: I = None
        self.v: B = None
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

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

a.y = f
l.s = m
l.u = m
l.q = i
e.r = c
k.r = i
k.q = i
k.w = l
k.x = a
k.y = b
k.u = b
k.s = e
k.o = e
c.t = e
m.u = a
m.o = e
m.s = k
m.q = c
f.o = e
f.x = l
f.u = h
f.v = h
f.r = i
f.t = c
f.p = a
b.t = e
b.o = c
i.o = f
h.s = m
h.u = m
h.q = i
assert c.t.r.t.r.t.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: B = None
        self.x: A = None
        self.y: H = None
        self.s: C = None
        self.o: C = None
        self.u: H = None
        self.q: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.u: B = None
        self.r: I = None
        self.v: B = None
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

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

a.y = f
l.s = m
l.u = m
l.q = i
e.r = c
k.r = i
k.q = i
k.w = l
k.x = a
k.y = b
k.u = b
k.s = e
k.o = e
c.t = e
m.u = a
m.o = e
m.s = k
m.q = c
f.o = e
f.x = l
f.u = h
f.v = h
f.r = i
f.t = c
f.p = a
b.t = e
b.o = c
i.o = f
h.s = m
h.u = m
h.q = i
assert c.t.r.t.r.t.r.t.txt == "e"