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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.x: A = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.w: F = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
m = C("m")
l = D("l")
i = E("i")
n = F("n")
f = G("f")
d = H("d")
a = F("a")

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.x: A = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.w: F = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
m = C("m")
l = D("l")
i = E("i")
n = F("n")
f = G("f")
d = H("d")
a = F("a")

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