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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: A = None
        self.z: C = None
        self.x: E = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: A = None
        self.z: C = None
        self.x: E = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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