class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: B = None
        self.q: D = None
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.w: D = None
        self.v: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = 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.u: F = None
        self.txt = txt

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

a.z = k
a.v = k
a.w = n
a.q = l
a.t = l
n.y = a
c.u = k
c.v = k
c.q = n
c.w = l
c.o = h
l.t = c
l.v = n
k.v = a
d.u = h
h.u = d
assert l.v.y.t.t.w.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: B = None
        self.q: D = None
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.w: D = None
        self.v: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = 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.u: F = None
        self.txt = txt

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

a.z = k
a.v = k
a.w = n
a.q = l
a.t = l
n.y = a
c.u = k
c.v = k
c.q = n
c.w = l
c.o = h
l.t = c
l.v = n
k.v = a
d.u = h
h.u = d
assert l.v.y.t.t.w.t.v.txt == "k"