class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: I = None
        self.y: E = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.x: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

h.v = l
h.r = l
h.y = j
h.s = a
m.s = h
m.r = j
a.v = h
b.p = n
b.s = j
b.x = m
b.y = i
j.t = i
n.p = j
n.u = e
e.y = b
i.w = b
c.w = l
c.v = b
l.w = c
l.v = b
assert j.t.w.x.r.t.w.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: I = None
        self.y: E = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.x: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

h.v = l
h.r = l
h.y = j
h.s = a
m.s = h
m.r = j
a.v = h
b.p = n
b.s = j
b.x = m
b.y = i
j.t = i
n.p = j
n.u = e
e.y = b
i.w = b
c.w = l
c.v = b
l.w = c
l.v = b
assert j.t.w.x.r.t.w.s.t.txt == "i"