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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: H = None
        self.y: G = None
        self.v: F = None
        self.p: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.txt = txt

c = A("c")
f = B("f")
l = C("l")
e = D("e")
i = E("i")
h = F("h")
k = G("k")
b = H("b")

c.v = f
f.r = b
f.x = l
f.p = k
l.z = k
e.s = i
e.x = b
e.y = k
e.v = h
e.p = f
i.q = l
i.y = l
i.v = c
h.o = b
k.o = f
b.y = c
b.x = l
assert f.p.o.r.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: H = None
        self.y: G = None
        self.v: F = None
        self.p: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.txt = txt

c = A("c")
f = B("f")
l = C("l")
e = D("e")
i = E("i")
h = F("h")
k = G("k")
b = H("b")

c.v = f
f.r = b
f.x = l
f.p = k
l.z = k
e.s = i
e.x = b
e.y = k
e.v = h
e.p = f
i.q = l
i.y = l
i.v = c
h.o = b
k.o = f
b.y = c
b.x = l
assert f.p.o.r.x.z.txt == "k"