class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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