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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: D = None
        self.s: C = None
        self.o: B = None
        self.x: F = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

i = A("i")
j = B("j")
d = C("d")
n = D("n")
m = E("m")
c = F("c")
k = G("k")
f = H("f")
l = I("l")
h = G("h")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: D = None
        self.s: C = None
        self.o: B = None
        self.x: F = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

i = A("i")
j = B("j")
d = C("d")
n = D("n")
m = E("m")
c = F("c")
k = G("k")
f = H("f")
l = I("l")
h = G("h")

i.u = c
i.s = f
j.v = i
j.w = f
d.q = f
n.v = m
n.p = d
m.u = d
m.v = d
m.t = c
c.s = f
k.t = n
f.y = d
f.s = d
f.u = m
l.r = c
l.x = c
l.t = c
l.p = c
l.q = n
l.s = d
l.o = j
h.t = n
assert f.u.t.s.u.t.s.y.q.s.txt == "d"