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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.o: E = None
        self.v: F = None
        self.q: E = None
        self.y: H = None
        self.p: H = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.o: E = None
        self.v: F = None
        self.q: E = None
        self.y: H = None
        self.p: H = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.txt = txt

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

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

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