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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.u: B = None
        self.s: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.u: B = None
        self.s: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

m.z = b
f.r = l
f.p = n
f.u = b
f.s = h
f.q = h
a.o = e
h.q = l
h.x = a
h.z = a
h.r = m
h.v = m
l.s = k
l.w = a
e.v = g
n.z = a
n.w = h
g.p = e
k.z = a
k.w = h
b.r = l
b.p = n
b.u = f
b.s = h
b.q = h
assert f.s.q.w.o.v.p.v.p.txt == "e"