class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

b.t = c
i.p = n
i.t = h
i.x = b
i.s = b
i.v = c
c.v = i
h.x = b
n.v = l
n.u = e
n.x = h
n.s = b
n.y = b
n.z = b
e.x = c
l.p = n
l.t = h
l.x = b
l.s = b
l.v = c
assert c.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

b.t = c
i.p = n
i.t = h
i.x = b
i.s = b
i.v = c
c.v = i
h.x = b
n.v = l
n.u = e
n.x = h
n.s = b
n.y = b
n.z = b
e.x = c
l.p = n
l.t = h
l.x = b
l.s = b
l.v = c
assert c.v.p.v.txt == "l"