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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.p: F = None
        self.w: B = None
        self.t: D = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: D = None
        self.t: B = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.p: F = None
        self.w: B = None
        self.t: D = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: D = None
        self.t: B = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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