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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

l.z = h
l.u = g
l.t = g
l.v = i
l.x = e
l.p = f
l.r = f
n.o = g
n.u = l
n.v = f
g.r = f
g.u = e
f.r = l
f.v = h
m.x = f
m.t = i
m.q = h
m.v = n
i.r = m
i.x = m
i.v = e
i.z = l
i.p = f
h.w = f
h.y = e
e.t = i
assert f.r.x.t.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: C = None
        self.v: F = None
        self.x: H = None
        self.t: C = None
        self.p: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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