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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.r: I = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: A = None
        self.r: F = None
        self.w: E = None
        self.o: B = None
        self.p: C = None
        self.t: C = None
        self.x: I = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: I = None
        self.z: H = None
        self.s: D = None
        self.x: E = None
        self.t: F = None
        self.u: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.u: B = None
        self.y: B = None
        self.o: D = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.y: C = None
        self.q: A = None
        self.z: F = None
        self.v: D = None
        self.p: G = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.r: I = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: A = None
        self.r: F = None
        self.w: E = None
        self.o: B = None
        self.p: C = None
        self.t: C = None
        self.x: I = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: I = None
        self.z: H = None
        self.s: D = None
        self.x: E = None
        self.t: F = None
        self.u: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.u: B = None
        self.y: B = None
        self.o: D = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.y: C = None
        self.q: A = None
        self.z: F = None
        self.v: D = None
        self.p: G = None
        self.w: B = None
        self.txt = txt

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

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