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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.z: A = None
        self.p: C = None
        self.s: C = None
        self.txt = txt

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

n.y = a
h.u = k
h.z = k
h.q = l
h.r = n
k.u = n
i.w = n
i.s = n
d.u = k
d.p = k
d.q = n
l.w = k
l.t = k
l.p = k
l.s = k
l.z = n
a.u = k
a.p = k
a.q = n
c.u = k
c.z = k
c.q = l
c.r = n
assert k.u.y.q.y.u.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.z: A = None
        self.p: C = None
        self.s: C = None
        self.txt = txt

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

n.y = a
h.u = k
h.z = k
h.q = l
h.r = n
k.u = n
i.w = n
i.s = n
d.u = k
d.p = k
d.q = n
l.w = k
l.t = k
l.p = k
l.s = k
l.z = n
a.u = k
a.p = k
a.q = n
c.u = k
c.z = k
c.q = l
c.r = n
assert k.u.y.q.y.u.u.y.txt == "a"