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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: F = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.w: C = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

l = A("l")
n = B("n")
e = C("e")
d = D("d")
h = E("h")
k = F("k")

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: F = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.w: C = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

l = A("l")
n = B("n")
e = C("e")
d = D("d")
h = E("h")
k = F("k")

l.v = k
l.q = k
l.t = h
n.x = e
n.p = l
n.y = d
e.p = h
e.s = k
e.q = k
d.u = n
d.v = n
d.y = n
d.z = k
d.p = h
d.s = h
h.u = e
h.w = e
h.o = d
h.t = k
h.z = l
k.y = h
assert d.p.o.y.x.q.txt == "k"