class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: G = None
        self.y: C = None
        self.p: A = None
        self.q: H = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: I = None
        self.s: G = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.u: F = None
        self.t: B = None
        self.v: E = None
        self.o: C = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: G = None
        self.y: C = None
        self.p: A = None
        self.q: H = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: I = None
        self.s: G = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.u: F = None
        self.t: B = None
        self.v: E = None
        self.o: C = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

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

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