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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: F = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: B = None
        self.y: G = None
        self.z: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: F = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: B = None
        self.y: G = None
        self.z: B = None
        self.w: D = None
        self.txt = txt

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

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