class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.z: E = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.y: F = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

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

c = A("c")
e = B("e")
n = C("n")
b = D("b")
i = E("i")
h = F("h")

c.v = e
c.s = i
c.z = i
c.p = b
e.t = b
n.v = c
n.o = c
n.u = h
b.s = c
b.t = i
b.y = h
b.p = h
b.q = e
i.z = n
i.u = b
h.y = n
h.r = b
assert n.o.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.z: E = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.y: F = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

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

c = A("c")
e = B("e")
n = C("n")
b = D("b")
i = E("i")
h = F("h")

c.v = e
c.s = i
c.z = i
c.p = b
e.t = b
n.v = c
n.o = c
n.u = h
b.s = c
b.t = i
b.y = h
b.p = h
b.q = e
i.z = n
i.u = b
h.y = n
h.r = b
assert n.o.v.t.txt == "b"