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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: F = None
        self.r: D = None
        self.z: B = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: F = None
        self.r: D = None
        self.z: B = None
        self.u: A = None
        self.txt = txt

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

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

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