class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: E = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.w: H = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: E = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.w: H = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

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