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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.y: A = None
        self.q: F = None
        self.u: E = None
        self.p: H = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.x: H = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: F = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.y: A = None
        self.q: F = None
        self.u: E = None
        self.p: H = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.x: H = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: F = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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