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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: E = None
        self.t: G = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: H = None
        self.z: F = None
        self.t: C = None
        self.y: G = None
        self.v: I = None
        self.s: B = None
        self.p: H = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: C = None
        self.u: H = None
        self.z: C = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: A = None
        self.z: I = None
        self.s: C = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: E = None
        self.t: G = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: H = None
        self.z: F = None
        self.t: C = None
        self.y: G = None
        self.v: I = None
        self.s: B = None
        self.p: H = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: C = None
        self.u: H = None
        self.z: C = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: A = None
        self.z: I = None
        self.s: C = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: G = None
        self.txt = txt

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

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

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